package customer

import (
	"server/global"
)

type CustomerBugModel struct {
	global.TD27_MODEL
	CustomerID      uint              `gorm:"not null;comment:客户ID"`
	Customer        CustomerModel     `gorm:"foreignKey:CustomerID"`
	EnvVersion      uint              `gorm:"not null;uniqueIndex:idx_cve_app_envVersion;comment:环境版本,3表示release-3，4表示release-4..."`
	CVE             string            `gorm:"not null;uniqueIndex:idx_cve_app_envVersion;comment:cve编号;size:64"`
	AttachmentID    uint              `gorm:"comment: 附件"`
	CustomerFile    CustomerFileModel `gorm:"foreignKey:AttachmentID"`
	BugLevel        uint8             `gorm:"not null;comment:Bug等级"`
	Status          uint8             `gorm:"not null;comment:状态,1:已修复,2:待修复;default:2"`
	APP             uint8             `gorm:"not null;uniqueIndex:idx_cve_app_envVersion;comment:影响应用"` // 不同的数字代表的应用名称见当前文件最下面的字典
	DiscoverVersion string            `gorm:"not null;comment:发现版本;size:64"`
	FeedbackID      uint              `gorm:"not null;comment:反馈者ID"`
	Feedback        PeopleModel       `gorm:"foreignKey:FeedbackID"`
	FixVersion      string            `gorm:"comment:修复版本;size:64"`
	FixerID         uint              `gorm:"comment:修复者ID"`
	Fixer           PeopleModel       `gorm:"foreignKey:FixerID"`
	BugDesc         string            `gorm:"type:text;comment:bug描述" `
	VerifyInfo      string            `gorm:"not null;type:text;comment:验证信息"`
	FixSuggest      string            `gorm:"not null;type:text;comment:修复建议"`
	Comment         string            `gorm:"type:text;comment:备注"`
	Tags            string            `gorm:"type:text;comment:标签"`
}

func (CustomerBugModel) TableName() string {
	return "customer_bug"
}

/** APP代码定义 */
/**
  {value: 1, label: "runtime"},
  {value: 2, label: "core-api-java"},
  {value: 3, label: "crystal-java-3"},
  {value: 4, label: "orchsym-web-3"},
  {value: 5, label: "hd-cfg-api"},
  {value: 6, label: "keycloak"},
  {value: 7, label: "elasticsearch"},
  {value: 8, label: "kibana"},
  {value: 9, label: "grafana"},
  {value: 10, label: "nginx"},
  {value: 11, label: "zookeeper"},
  {value: 12, label: "cassandra"},
  {value: 13, label: "mysql"},
  {value: 14, label: "redis"},
*/
